import service from "../utils/request";

export function loadLocalFile(obj) {
    return service.post('/shopBack/file/loadLocalFile', obj, {
        headers: { 'Content-Type': 'multipart/form-data' }
    })
}

export function FtpUpload(obj) {
    return service.post('/shopBack/file/FtpUpload', obj, {
        headers: { 'Content-Type': 'multipart/form-data' }
    })
}

// 原文件名上传图片到服务器
export function uploadImageToServerOriginalName(obj) { 
        return service.post('/shopBack/file/uploadImageToServerOriginalName', obj, {
        headers: { 'Content-Type': 'multipart/form-data' }
    })
}

// 根据编号查文件信息
export function getImageByteById(id) {
    return service.get('/shopBack/file/getImageByteById2', {
        headers: { 'Content-Type': 'application/json' },
        params: {
            id: id,
        }
    })
}

// 根据编号直接获取文件
export function getImageFileById(id) {
    return service.get('/shopBack/file/getImageFileById', {
        headers: { 'Content-Type': 'application/json' },
        params: {
            id: id,
        }
    })
}
// 上传文件为字节流
export function uploadFileToBytes(obj) { 
    return service.post('/shopBack/file/uploadFileToBytes', obj, {
    headers: { 'Content-Type': 'multipart/form-data' }
})
}